package com.lzh.controller;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Question StudentController
 * @Date 2022/11/9 23:00
 * @Solution
 */
//@Controller
public class StudentController implements BeanNameAware {
    private String name;
    public void setName(String name) {
        System.out.println("setName");
        this.name=name;
    }
    @PostConstruct
    public void postConstruct() {
        System.out.println("postConstruct");
    }

    @PreDestroy
    public void preDestroy() {
        System.out.println("preDestroy");
    }

    @Override
    public void setBeanName(String s) {
        System.out.println("setBeanName");
    }

    public void initMethod() {
        System.out.println("initMethod");
    }

}
